import axiosHttp from "../../http"

// 获取数据
async function getData(data) {
  return axiosHttp({
    url: "/news/getdata",
    method: "get",
    data,
  }).then((res) => {
    return res
  })
}

// 进入新闻详情页
async function getDetail(data) {
  console.log(data)
  return axiosHttp({
    url: "/news/getdetail",
    method: "post",
    data,
  }).then((res) => {
    return res
  })
}

// 插入数据
async function putData(data) {
  console.log(data)
  return axiosHttp({
    url: "/news/putdata",
    method: "post",
    data,
  }).then((res) => {
    return res
  })
}

// 撤销逻辑
async function delData(data) {
  console.log(data)
  return axiosHttp({
    url: "/news/deldata",
    method: "post",
    data,
  }).then((res) => {
    return res
  })
}

export default {
  getData,
  getDetail,
  putData,
  delData,
}
